package com.asia.bomc.workflow.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name="BOMC_USER")
public class BomcUser implements Serializable{
	private static final long serialVersionUID = 5498840264759038369L;
	private String bomcUserId;
	private String password;
	private String enabled;
	private String partyId;
	private Timestamp createdStamp;
	private Timestamp updatedStamp;
	private Set<SecurityRole> roles;
	@Id
	@Column(name="BOMC_USER_ID",length=20)
	public String getBomcUserId() {
		return bomcUserId;
	}
	public void setBomcUserId(String bomcUserId) {
		this.bomcUserId = bomcUserId;
	}
	@Column(name="CURRENT_PASSWORD",length=255)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Column(name="ENABLED",length=1)
	public String getEnabled() {
		return enabled;
	}
	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}
	@Column(name="PARTY_ID",length=20)
	public String getPartyId() {
		return partyId;
	}
	public void setPartyId(String partyId) {
		this.partyId = partyId;
	}
	@Column(name="CREATED_STAMP")
	public Timestamp getCreatedStamp() {
		return createdStamp;
	}
	public void setCreatedStamp(Timestamp createdStamp) {
		this.createdStamp = createdStamp;
	}
	@Column(name="UPDATED_STAMP")
	public Timestamp getUpdatedStamp() {
		return updatedStamp;
	}
	public void setUpdatedStamp(Timestamp updatedStamp) {
		this.updatedStamp = updatedStamp;
	}
	@ManyToMany(fetch=FetchType.EAGER)
	@JoinTable(name = "BOMC_USER_ROLE", joinColumns = { @JoinColumn(name = "BOMC_USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "SECURITY_ROLE_ID") })
	
	public Set<SecurityRole> getRoles() {
		return roles;
	}
	public void setRoles(Set<SecurityRole> roles) {
		this.roles = roles;
	}

	
}
